#include "../include/gyroscope.h"

// 构造函数定义
Gyroscope::Gyroscope(const std::string &model, const std::string &manufacturer)
    : model(model), manufacturer(manufacturer) {}

Gyroscope::Gyroscope(): Gyroscope("CH110", "NXP") {}

// 将属性写入文件的方法
void Gyroscope::writeToFile(std::ofstream &file) {
    if (file.is_open()) {
        file << "9轴陀螺仪：" << std::endl;
        file << " Model: " << model << std::endl;
        file << " Manufacturer: " << manufacturer << std::endl;
    }
}

// 打印属性的方法
void Gyroscope::print() const {
    std::cout << "9轴陀螺仪：" << std::endl;
    std::cout << " Model: " << model << std::endl;
    std::cout << " Manufacturer: " << manufacturer << std::endl;
}